$(function () {
    var update = localStorage.getItem("update");
    alert("当前员工为为：" + update);
    $("#dv1").html("当前员工名字：" + update);
    $("#old").val(update);
    $("#name").val(update);
    $("#sex").val("0");
    $("#job_id").val("8");
})

function submits(){
    // 控制文档加载完成以后 选中性别
    /** 员工表单提交 */
    //$("#employeeForm").submit(function(){
    var name = $("#name");
    var cardId = $("#cardId");
    var education = $("#education");
    var email = $("#email");
    var phone = $("#phone");
    var tel = $("#tel");
    var party = $("#party");
    var qqNum = $("#qqNum");
    var address = $("#address");
    var postCode = $("#postCode");
    var birthday = $("#birthday");
    var race = $("#race");
    var speciality = $("#speciality");
    var hobby = $("#hobby");
    var msg = "";
    if ($.trim(name.val()) == ""){
        msg = "姓名不能为空！";
        name.focus();
    }else if ($.trim(cardId.val()) == ""){
        msg = "身份证号码不能为空！";
        cardId.focus();
    }else if (!/^[1-9]\d{16}[0-9A-Za-z]$/.test($.trim(cardId.val()))){
        msg = "身份证号码格式不正确！";
        cardId.focus();
    }else if ($.trim(education.val()) == ""){
        msg = "学历不能为空！";
        education.focus();
    }else if ($.trim(email.val()) == ""){
        msg = "邮箱不能为空！";
        email.focus();
    }else if (!/^\w+@\w{2,3}\.\w{2,6}$/.test($.trim(email.val()))){
        msg = "邮箱格式不正确！";
        email.focus();
    }else if ($.trim(phone.val()) == ""){
        msg = "手机号码不能为空！";
        phone.focus();
    }else if (!/^1[3|5|8]\d{9}$/.test($.trim(phone.val()))){
        msg = "手机号码格式不正确！";
        phone.focus();
    }else if ($.trim(tel.val()) == ""){
        msg = "电话号码不能为空！";
        tel.focus();
    }else if (!/^0\d{2,3}-?\d{7,8}$/.test($.trim(tel.val()))){
        msg = "电话号码格式不正确！";
        tel.focus();
    }else if ($.trim(party.val()) == ""){
        msg = "政治面貌不能为空！";
        party.focus();
    }else if ($.trim(qqNum.val()) == ""){
        msg = "QQ号码不能为空！";
        qqNum.focus();
    }else if (!/^\d{6,}$/.test($.trim(qqNum.val()))){
        msg = "QQ号码格式不正确！";
        qqNum.focus();
    }else if ($.trim(address.val()) == ""){
        msg = "地址不能为空！";
        address.focus();
    }else if ($.trim(postCode.val()) == ""){
        msg = "邮政编码不能为空！";
        postCode.focus();
    }else if (!/^[1-9]\d{5}$/.test($.trim(postCode.val()))){
        msg = "邮政编码格式不正确！";
        postCode.focus();
    }else if ($.trim(birthday.val()) == ""){
        msg = "出生日期不能为空！";
        birthday.focus();
    }else if (!birthday.val()){
//					!/^\d{4}-\d{2}-\d{2}$/.test($.trim(birthday.val()))
        msg = "出生日期格式不正确！";
        birthday.focus();
    }else if ($.trim(race.val()) == ""){
        msg = "民族不能为空！";
        race.focus();
    }else if ($.trim(speciality.val()) == ""){
        msg = "专业不能为空！";
        speciality.focus();
    }else if ($.trim(hobby.val()) == ""){
        msg = "爱好不能为空！";
        hobby.focus();
    }
    if (msg != ""){
        $.ligerDialog.error(msg);
        return false;
    }else{
        alert("成功修改用户："+localStorage.getItem("update"));
        return true;
    }

    //$("#employeeForm").submit();
}